/* 
 * File:   Subject.h
 * Author: ivar
 *
 * Created on June 13, 2010, 5:32 PM
 */

#ifndef _SUBJECT_H
#define	_SUBJECT_H
#include <vector>
//#include "Observer.h"

class Observer;
class Subject {
public:    
    virtual ~Subject();

    virtual void attach(Observer *o); //attaches a new observer to the list of observers
    virtual void detach(Observer *o); //removes a subscribing observer
    virtual void detachAll(); //removes a subscribing observer
    virtual void notify(); //notifies all the observers about change. 
protected:
    Subject();
    Subject(const Subject& orig);
private:
    std::vector<Observer*> *mObservers; //vector 'cus list is bleh.

};

#endif	/* _SUBJECT_H */

